//
//  SfcRX9DetailViewController.m
//  PlayBall
//
//  Created by Jdd‘s macbook on 13-9-27.
//
//

#import "JddSfcRX9DetailViewController.h"
#import "JddSFcBuyDetailItemCell.h"
#import "JddDefine.h"
#import "JddCommonFunction.h"
@interface JddSfcRX9DetailViewController ()

@end

@implementation JddSfcRX9DetailViewController

- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath{
    return 20.0;
    
}
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section{
    return [self.tableNumberList count];
}

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{
    //任选9/胜负彩
        JddSFcBuyDetailItemCell *cell = [JddSFcBuyDetailItemCell getInstanceView];
        NSDictionary *ssqNumber = [self.tableNumberList objectAtIndex:indexPath.row];
        cell.nMu.text = [ssqNumber objectForKey:@"no"];
        NSString *str = [ssqNumber objectForKey:@"vs"];
        NSString *score = [ssqNumber objectForKey:@"score"];
//        NSArray *teams = [str componentsSeparatedByString:[NSString stringWithFormat:@"(%@)", score]];
//        if([teams count]>1){
//            cell.hTeam.text = [teams objectAtIndex:0];
//            cell.vTeam.text = [teams objectAtIndex:1];
//        }else{
//            teams = [str componentsSeparatedByString:@"(vs)"];
//            if([teams count]>1){
//                cell.hTeam.text = [teams objectAtIndex:0];
//                cell.vTeam.text = [teams objectAtIndex:1];
//            }
//        }
        cell.hTeam.text = str;
        NSString * betnum = [ssqNumber objectForKey:@"content"];
        NSString *result = [ssqNumber objectForKey:@"cg"];
        cell.betNum.attributedText = [JddCommonFunction convertHTMLFontRedWithResult:betnum AndCellLabel:cell.betNum];
//        cell.score.text = score;
//        NSAttributedString * attrStr = [[NSAttributedString alloc] initWithData:[score dataUsingEncoding:NSUnicodeStringEncoding] options:@{ NSDocumentTypeDocumentAttribute: NSHTMLTextDocumentType } documentAttributes:nil error:nil];
        cell.score.attributedText = [JddCommonFunction convertHTMLFontRedWithResult:score AndCellLabel:cell.score];
    
        cell.result.text = result;
        return cell;
}

- (void)viewDidUnload {
    [self setTableView:nil];
    [super viewDidUnload];
}
@end
